package com.example.util;

import java.util.ArrayList;
import java.util.Scanner;

public class Main {


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();


        ArrayList<Integer[]> list = new ArrayList<>();
        Integer[] line = new Integer[3];
        line[0] = in.nextInt();
        line[1] = in.nextInt();
        line[2] = in.nextInt();
        list.add(line);
        int a = line[0];
        int b = line[1];
        int c = line[2];

        for (int i = 1; i < n; i++) {
            Integer[] line1 = new Integer[3];
            line[0] = in.nextInt();
            line[1] = in.nextInt();
            line[2] = in.nextInt();
            list.add(line1);
        }
        for (int i = 0; i < list.size(); i++) {

            if (line[2].equals(a)  ) {

                System.out.println("we are a team");
            } else if (line[2].equals(1)) {
                System.out.println("we are not a team");
            } else {
                System.out.println("da pian zi");
            }
        }
    }



}
